3.6.50 \(\int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx\) [550]

Optimal. Leaf size=79 \[ -\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d} \]

[Out]

-a*arctanh(sin(d*x+c))/b^2/d+sec(d*x+c)/b/d-arctanh(cos(d*x+c)*(b-a*tan(d*x+c))/(a^2+b^2)^(1/2))*(a^2+b^2)^(1/
2)/b^2/d

________________________________________________________________________________________

Rubi [A]
time = 0.08, antiderivative size = 79, normalized size of antiderivative = 1.00, number of steps used = 5, number of rules used = 5, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.238, Rules used = {3591, 3567, 3855, 3590, 212} \begin {gather*} -\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}+\frac {\sec (c+d x)}{b d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Sec[c + d*x]^3/(a + b*Tan[c + d*x]),x]

[Out]

-((a*ArcTanh[Sin[c + d*x]])/(b^2*d)) - (Sqrt[a^2 + b^2]*ArcTanh[(Cos[c + d*x]*(b - a*Tan[c + d*x]))/Sqrt[a^2 +
 b^2]])/(b^2*d) + Sec[c + d*x]/(b*d)

Rule 212

Int[((a_) + (b_.)*(x_)^2)^(-1), x_Symbol] :> Simp[(1/(Rt[a, 2]*Rt[-b, 2]))*ArcTanh[Rt[-b, 2]*(x/Rt[a, 2])], x]
 /; FreeQ[{a, b}, x] && NegQ[a/b] && (GtQ[a, 0] || LtQ[b, 0])

Rule 3567

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_.)*((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Simp[b*((d*Sec[
e + f*x])^m/(f*m)), x] + Dist[a, Int[(d*Sec[e + f*x])^m, x], x] /; FreeQ[{a, b, d, e, f, m}, x] && (IntegerQ[2
*m] || NeQ[a^2 + b^2, 0])

Rule 3590

Int[sec[(e_.) + (f_.)*(x_)]/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-f^(-1), Subst[Int[1/(a^
2 + b^2 - x^2), x], x, (b - a*Tan[e + f*x])/Sec[e + f*x]], x] /; FreeQ[{a, b, e, f}, x] && NeQ[a^2 + b^2, 0]

Rule 3591

Int[((d_.)*sec[(e_.) + (f_.)*(x_)])^(m_)/((a_) + (b_.)*tan[(e_.) + (f_.)*(x_)]), x_Symbol] :> Dist[-d^2/b^2, I
nt[(d*Sec[e + f*x])^(m - 2)*(a - b*Tan[e + f*x]), x], x] + Dist[d^2*((a^2 + b^2)/b^2), Int[(d*Sec[e + f*x])^(m
 - 2)/(a + b*Tan[e + f*x]), x], x] /; FreeQ[{a, b, d, e, f}, x] && NeQ[a^2 + b^2, 0] && IGtQ[m, 1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \frac {\sec ^3(c+d x)}{a+b \tan (c+d x)} \, dx &=-\frac {\int \sec (c+d x) (a-b \tan (c+d x)) \, dx}{b^2}+\frac {\left (a^2+b^2\right ) \int \frac {\sec (c+d x)}{a+b \tan (c+d x)} \, dx}{b^2}\\ &=\frac {\sec (c+d x)}{b d}-\frac {a \int \sec (c+d x) \, dx}{b^2}-\frac {\left (a^2+b^2\right ) \text {Subst}\left (\int \frac {1}{a^2+b^2-x^2} \, dx,x,\cos (c+d x) (b-a \tan (c+d x))\right )}{b^2 d}\\ &=-\frac {a \tanh ^{-1}(\sin (c+d x))}{b^2 d}-\frac {\sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {\cos (c+d x) (b-a \tan (c+d x))}{\sqrt {a^2+b^2}}\right )}{b^2 d}+\frac {\sec (c+d x)}{b d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]
time = 0.16, size = 109, normalized size = 1.38 \begin {gather*} \frac {2 \sqrt {a^2+b^2} \tanh ^{-1}\left (\frac {-b+a \tan \left (\frac {1}{2} (c+d x)\right )}{\sqrt {a^2+b^2}}\right )+a \left (\log \left (\cos \left (\frac {1}{2} (c+d x)\right )-\sin \left (\frac {1}{2} (c+d x)\right )\right )-\log \left (\cos \left (\frac {1}{2} (c+d x)\right )+\sin \left (\frac {1}{2} (c+d x)\right )\right )\right )+b \sec (c+d x)}{b^2 d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Sec[c + d*x]^3/(a + b*Tan[c + d*x]),x]

[Out]

(2*Sqrt[a^2 + b^2]*ArcTanh[(-b + a*Tan[(c + d*x)/2])/Sqrt[a^2 + b^2]] + a*(Log[Cos[(c + d*x)/2] - Sin[(c + d*x
)/2]] - Log[Cos[(c + d*x)/2] + Sin[(c + d*x)/2]]) + b*Sec[c + d*x])/(b^2*d)

________________________________________________________________________________________

Maple [A]
time = 0.42, size = 129, normalized size = 1.63

method result size
derivativedivides \(\frac {-\frac {2 \left (-a^{2}-b^{2}\right ) \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}-\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}}{d}\) \(129\)
default \(\frac {-\frac {2 \left (-a^{2}-b^{2}\right ) \arctanh \left (\frac {2 a \tan \left (\frac {d x}{2}+\frac {c}{2}\right )-2 b}{2 \sqrt {a^{2}+b^{2}}}\right )}{b^{2} \sqrt {a^{2}+b^{2}}}-\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )-1\right )}{b^{2}}+\frac {1}{b \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}-\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )+1\right )}{b^{2}}}{d}\) \(129\)
risch \(\frac {2 \,{\mathrm e}^{i \left (d x +c \right )}}{d b \left ({\mathrm e}^{2 i \left (d x +c \right )}+1\right )}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-i\right )}{d \,b^{2}}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+i\right )}{d \,b^{2}}+\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}+\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{2}}-\frac {\sqrt {a^{2}+b^{2}}\, \ln \left ({\mathrm e}^{i \left (d x +c \right )}-\frac {i a -b}{\sqrt {a^{2}+b^{2}}}\right )}{d \,b^{2}}\) \(167\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(sec(d*x+c)^3/(a+b*tan(d*x+c)),x,method=_RETURNVERBOSE)

[Out]

1/d*(-2/b^2*(-a^2-b^2)/(a^2+b^2)^(1/2)*arctanh(1/2*(2*a*tan(1/2*d*x+1/2*c)-2*b)/(a^2+b^2)^(1/2))-1/b/(tan(1/2*
d*x+1/2*c)-1)+a/b^2*ln(tan(1/2*d*x+1/2*c)-1)+1/b/(tan(1/2*d*x+1/2*c)+1)-a/b^2*ln(tan(1/2*d*x+1/2*c)+1))

________________________________________________________________________________________

Maxima [B] Leaf count of result is larger than twice the leaf count of optimal. 163 vs. \(2 (77) = 154\).
time = 0.48, size = 163, normalized size = 2.06 \begin {gather*} -\frac {\frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + 1\right )}{b^{2}} - \frac {a \log \left (\frac {\sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - 1\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} + \sqrt {a^{2} + b^{2}}}{b - \frac {a \sin \left (d x + c\right )}{\cos \left (d x + c\right ) + 1} - \sqrt {a^{2} + b^{2}}}\right )}{b^{2}} - \frac {2}{b - \frac {b \sin \left (d x + c\right )^{2}}{{\left (\cos \left (d x + c\right ) + 1\right )}^{2}}}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="maxima")

[Out]

-(a*log(sin(d*x + c)/(cos(d*x + c) + 1) + 1)/b^2 - a*log(sin(d*x + c)/(cos(d*x + c) + 1) - 1)/b^2 + sqrt(a^2 +
 b^2)*log((b - a*sin(d*x + c)/(cos(d*x + c) + 1) + sqrt(a^2 + b^2))/(b - a*sin(d*x + c)/(cos(d*x + c) + 1) - s
qrt(a^2 + b^2)))/b^2 - 2/(b - b*sin(d*x + c)^2/(cos(d*x + c) + 1)^2))/d

________________________________________________________________________________________

Fricas [B] Leaf count of result is larger than twice the leaf count of optimal. 191 vs. \(2 (77) = 154\).
time = 0.42, size = 191, normalized size = 2.42 \begin {gather*} -\frac {a \cos \left (d x + c\right ) \log \left (\sin \left (d x + c\right ) + 1\right ) - a \cos \left (d x + c\right ) \log \left (-\sin \left (d x + c\right ) + 1\right ) - \sqrt {a^{2} + b^{2}} \cos \left (d x + c\right ) \log \left (-\frac {2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} - 2 \, a^{2} - b^{2} + 2 \, \sqrt {a^{2} + b^{2}} {\left (b \cos \left (d x + c\right ) - a \sin \left (d x + c\right )\right )}}{2 \, a b \cos \left (d x + c\right ) \sin \left (d x + c\right ) + {\left (a^{2} - b^{2}\right )} \cos \left (d x + c\right )^{2} + b^{2}}\right ) - 2 \, b}{2 \, b^{2} d \cos \left (d x + c\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="fricas")

[Out]

-1/2*(a*cos(d*x + c)*log(sin(d*x + c) + 1) - a*cos(d*x + c)*log(-sin(d*x + c) + 1) - sqrt(a^2 + b^2)*cos(d*x +
 c)*log(-(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 - 2*a^2 - b^2 + 2*sqrt(a^2 + b^2)*(b*co
s(d*x + c) - a*sin(d*x + c)))/(2*a*b*cos(d*x + c)*sin(d*x + c) + (a^2 - b^2)*cos(d*x + c)^2 + b^2)) - 2*b)/(b^
2*d*cos(d*x + c))

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \frac {\sec ^{3}{\left (c + d x \right )}}{a + b \tan {\left (c + d x \right )}}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)**3/(a+b*tan(d*x+c)),x)

[Out]

Integral(sec(c + d*x)**3/(a + b*tan(c + d*x)), x)

________________________________________________________________________________________

Giac [A]
time = 0.54, size = 136, normalized size = 1.72 \begin {gather*} -\frac {\frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) + 1 \right |}\right )}{b^{2}} - \frac {a \log \left ({\left | \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 1 \right |}\right )}{b^{2}} + \frac {\sqrt {a^{2} + b^{2}} \log \left (\frac {{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b - 2 \, \sqrt {a^{2} + b^{2}} \right |}}{{\left | 2 \, a \tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right ) - 2 \, b + 2 \, \sqrt {a^{2} + b^{2}} \right |}}\right )}{b^{2}} + \frac {2}{{\left (\tan \left (\frac {1}{2} \, d x + \frac {1}{2} \, c\right )^{2} - 1\right )} b}}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(sec(d*x+c)^3/(a+b*tan(d*x+c)),x, algorithm="giac")

[Out]

-(a*log(abs(tan(1/2*d*x + 1/2*c) + 1))/b^2 - a*log(abs(tan(1/2*d*x + 1/2*c) - 1))/b^2 + sqrt(a^2 + b^2)*log(ab
s(2*a*tan(1/2*d*x + 1/2*c) - 2*b - 2*sqrt(a^2 + b^2))/abs(2*a*tan(1/2*d*x + 1/2*c) - 2*b + 2*sqrt(a^2 + b^2)))
/b^2 + 2/((tan(1/2*d*x + 1/2*c)^2 - 1)*b))/d

________________________________________________________________________________________

Mupad [B]
time = 3.87, size = 310, normalized size = 3.92 \begin {gather*} \frac {2\,\mathrm {atanh}\left (\frac {64\,a^2\,\sqrt {a^2+b^2}}{64\,a^2\,b+\frac {64\,a^4}{b}+128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )+128\,a\,b^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {128\,a\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^2+\frac {64\,a^4}{b^2}+\frac {128\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{b}+128\,a\,b\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}+\frac {64\,a^3\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,\sqrt {a^2+b^2}}{64\,a^4+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a^3\,b+64\,a^2\,b^2+128\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )\,a\,b^3}\right )\,\sqrt {a^2+b^2}}{b^2\,d}-\frac {2\,a\,\mathrm {atanh}\left (\frac {64\,a^2\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^2+\frac {64\,a^4}{b^2}}+\frac {64\,a^4\,\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}{64\,a^4+64\,a^2\,b^2}\right )}{b^2\,d}-\frac {2}{b\,d\,\left ({\mathrm {tan}\left (\frac {c}{2}+\frac {d\,x}{2}\right )}^2-1\right )} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(1/(cos(c + d*x)^3*(a + b*tan(c + d*x))),x)

[Out]

(2*atanh((64*a^2*(a^2 + b^2)^(1/2))/(64*a^2*b + (64*a^4)/b + 128*a^3*tan(c/2 + (d*x)/2) + 128*a*b^2*tan(c/2 +
(d*x)/2)) + (128*a*tan(c/2 + (d*x)/2)*(a^2 + b^2)^(1/2))/(64*a^2 + (64*a^4)/b^2 + (128*a^3*tan(c/2 + (d*x)/2))
/b + 128*a*b*tan(c/2 + (d*x)/2)) + (64*a^3*tan(c/2 + (d*x)/2)*(a^2 + b^2)^(1/2))/(64*a^4 + 64*a^2*b^2 + 128*a*
b^3*tan(c/2 + (d*x)/2) + 128*a^3*b*tan(c/2 + (d*x)/2)))*(a^2 + b^2)^(1/2))/(b^2*d) - (2*a*atanh((64*a^2*tan(c/
2 + (d*x)/2))/(64*a^2 + (64*a^4)/b^2) + (64*a^4*tan(c/2 + (d*x)/2))/(64*a^4 + 64*a^2*b^2)))/(b^2*d) - 2/(b*d*(
tan(c/2 + (d*x)/2)^2 - 1))

________________________________________________________________________________________